<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript" src="../res/js/jquery-1.4.3.js"></script>
<style type="text/css">
.header {
	border: 1px solid white;
	border-radius: 15px;
	width: 45%;
	height: 200px;
	margin: 200px auto;
	left: center;
	text-align: center;
	padding: 100px;
}
body {
	background-size: 100%;
}
</style>
</head>
<body style="background-image: url('../res/img/background.jpg'); background-repeat: no-repeat;">
	<div class="header">

			<form action="doreg" name="zhuce">
			帐号：<input name="loginname">
			<br /> <br> 
			密码：<input type="password" name="password">
			<br /> <br> 
			姓名：<input name="username">
			<br /> <br> 
			邮箱：<input name="youxiang">
			<br /> <br> 
			手机：<input name="qq">
			<br /> 
			性别： <input class="hk" type="radio" name="sex" value="1">男
			 <input class="hk" type="radio" name="sex" value="2">女
			 <br>
			<button type="button" onclick="tijiao()">提交</button>
			<button type="button" onclick="window.open('denglu.jsp')">登录</button>
		</form>
		<script type="text/javascript">
		function tijiao() {
			/* var loginname= $('input[name="loginname"]').val();
			var password= $('input[name="password"]').val();
			var username= $('input[name="username"]').val();
			var sex= $('.hk').val(); */
			$.ajax({
				url : "doreg",
				data : $("form").serialize(),
				success : function(data) {
					var obj = JSON.parse(data);
					alert($("form").serialize());
					if (obj.code == 1) {
						alert(obj.massage);
					} else {
						alert("hhjkkk");
					}
				}
			});
		}
	</script>
</body>
</html>
